(provide 'zhang_appearance)

;;==========close init screen and set scratch message====
(setq inhibit-startup-message t)
(setq initial-scratch-message "Hey, man, work hard!")
;;==========close tools bar===================
(tool-bar-mode -1)
;;=========display filename on title bar=======
(setq frame-title-format (list "%f ---  @" system-name))
;;===========set timeplan=================
(setq display-time-24hr-format t) 
(setq display-time-day-and-date t) 
(display-time) 
;===========set fill column==============
;; 直接设定fill-column好像没有用，必须用 custom-set-variables方式
;;(setq fill-column 120) 
(custom-set-variables
 '(fill-column 100)
 )
(setq-default auto-fill-function 'do-auto-fill)
;;==============Highlight grammer============
(global-font-lock-mode t)
;;==============Highlight selected block=====
(setq transient-mark-mode t)
;;===========load color theme==================
(require 'color-theme)
(color-theme-initialize)
;;(color-theme-arjen)
;;(color-theme-tty-dark)
;;(color-theme-deep-blue)
;;(color-theme-classic)
;;(color-theme-comidia)
;;(color-theme-dark-blue2)
;;(color-theme-charcoal-black)
;;(color-theme-blue-mood)
;;(color-theme-subtle-hacker)
;;(color-theme-blackboard) 
;;(color-theme-jonadabian-slate)
(color-theme-oceandeep)
;;(add-to-list 'load-path "~/plugin/extraload/emacs-color-theme-solarized/")
;;(require 'color-theme-solarized)
;;(color-theme-solarized-light)
(set-background-color "grey25")
(set-foreground-color "grey85")
(set-cursor-color "steelblue")
;;=========color theme zenburn==============
;;(require 'zenburn)
;;(zenburn)
;;(color-theme-initialize)
;;(color-theme-oceandeep)
;;==============copy between emacs and others===
(setq x-select-enable-clipboard t)
;;==========set user profile==================
(setq user-full-name "ZHANG Xiaolei")
(setq user-mail-address "xiaoleizhang@hit.edu.cn")
;;==========load ibuffer mode====================================
(require 'ibuffer)
(require 'ibuffer nil t)
(require 'ibuf-ext nil t)
(when (featurep 'ibuffer)
  (global-set-key (kbd "C-x C-b") 'ibuffer)
  (add-hook 'ibuffer-mode-hook
            (lambda ()
              (setq ibuffer-filter-groups
                    '(
                      ("*Buffer*" (name . "\\*.*\\*"))
                      ("Dired" (mode . dired-mode))
                      ("Org" (mode . org-mode))
                      ("Python" (mode . python-mode))
                      ("Latex"  (mode . latex-mode))
                      ("C & C++" (or (mode . c-mode)
                                                (mode . c++-mode)))
                      ("Elisp" (or (mode . emacs-lisp-mode)
                                   (mode . lisp-interaction-mode)))
                      ))))
)

;;===========close beep when wrong operation====
(setq visible-bell t)
;;============reload file if changed====================
(global-auto-revert-mode 1)
;;================insert date & time to the point====================
(defun my-insert-date ()
  (interactive)
  (insert (format-time-string "%Y/%m/%d %H:%M:%S" (current-time))))
(global-set-key (kbd "C-c d") 'my-insert-date)
;;================set shell-mode autocomplete=====================
(setq shell-completion-execonly nil)
;;============================================
;;括号匹配时显示另外一边的括号，而不是烦人的跳到另一个括号。
(show-paren-mode t)
;;(setq show-paren-style 'parentheses)
;;===============show weather================
(require 'cn-weather)
(setq cn-weather-city "哈尔滨")
;;(display-cn-weather-mode t)

;;===============Change cursor dynamically========
;;(require 'cursor-chg)  ; Load the library
;;(toggle-cursor-type-when-idle 1) ; Turn on cursor change when Emacs is idle
;;(change-cursor-mode 1) ; Turn on change for overwrite, read-only, and input mode

;;===============change cursor appearence=========
;(setq-default cursor-type 'bar)
;;(setq-default cursor-type 'hollow)
;;(set-cursor-color "green")
;;(setq-default cursor-type 'box)
;;(setq-default cursor-type 'hbar)

;;==============set mode line ===================
;; Set the modeline to tell me the filename, hostname, etc..
;; (setq-default mode-line-format
;;       (list " "
;;             ; */% indicators if the file has been modified
;;             'mode-line-modified
;;             "--"
;;             ; the name of the buffer (i.e. filename)
;;             ; note this gets automatically highlighted
;;             'mode-line-buffer-identification
;;             "--"
;;             ; major and minor modes in effect
;;             'mode-line-modes
;;             ; if which-func-mode is in effect, display which
;;             ; function we are currently in.
;;             '(which-func-mode ("" which-func-format "--"))
;;             ; line, column, file %
;;             'mode-line-position
;;             "--"
;;             ; if vc-mode is in effect, display version control
;;             ; info here
;;             `(vc-mode vc-mode)
;;             "--"
;;             ; hostname
;;             'system-name
;;             ; dashes sufficient to fill rest of modeline.
;;             "-%-"
;;             )
;; )
;;====================set chinese calendar========================
(require 'cal-china-x)
(setq calendar-mark-holidays-flag t)
(setq cal-china-x-important-holidays cal-china-x-chinese-holidays)
(setq calendar-holidays cal-china-x-important-holidays)
;;;自定义的节日
(setq holiday-general-holidays
      '((holiday-fixed 9 10   "教师节")
        (holiday-lunar 9 9    "重阳节")
        (holiday-float 11 4 4 "感恩节")))

(setq holiday-other-holidays
      '((holiday-lunar 5 14   "小木头 的生日")))

(setq cal-china-x-priority1-holidays cal-china-x-chinese-holidays)
(setq calendar-holidays
  (append holiday-general-holidays cal-china-x-priority1-holidays
holiday-other-holidays))
